Optimal. Leaf size=191 \[ \frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.37, antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.132, Rules used = {3677, 3679, 12,
3625, 211} \begin {gather*} -\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {(-9 B+7 i A) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (B+i A) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 211
Rule 3625
Rule 3677
Rule 3679
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}} \, dx &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {\int \frac {\sqrt {a+i a \tan (c+d x)} \left (\frac {1}{2} a (5 A+3 i B)-2 a (i A-B) \tan (c+d x)\right )}{\tan ^{\frac {5}{2}}(c+d x)} \, dx}{a^2}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {2 \int \frac {\sqrt {a+i a \tan (c+d x)} \left (-\frac {1}{4} a^2 (7 i A-9 B)-\frac {1}{2} a^2 (5 A+3 i B) \tan (c+d x)\right )}{\tan ^{\frac {3}{2}}(c+d x)} \, dx}{3 a^3}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {4 \int -\frac {3 a^3 (A-i B) \sqrt {a+i a \tan (c+d x)}}{8 \sqrt {\tan (c+d x)}} \, dx}{3 a^4}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}-\frac {(A-i B) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx}{2 a}\\ &=\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {(a (i A+B)) \text {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {A+i B}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {(5 A+3 i B) \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {(7 i A-9 B) \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.40, size = 221, normalized size = 1.16 \begin {gather*} \frac {e^{-i (c+d x)} \left (-3 B \left (1-6 e^{2 i (c+d x)}+5 e^{4 i (c+d x)}\right )+i A \left (3-18 e^{2 i (c+d x)}+7 e^{4 i (c+d x)}\right )+3 (i A+B) e^{i (c+d x)} \left (-1+e^{2 i (c+d x)}\right )^{3/2} \tanh ^{-1}\left (\frac {e^{i (c+d x)}}{\sqrt {-1+e^{2 i (c+d x)}}}\right )\right ) (A+B \tan (c+d x))}{6 d \left (-1+e^{2 i (c+d x)}\right ) (A \cos (c+d x)+B \sin (c+d x)) \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 745 vs. \(2 (155 ) = 310\).
time = 0.14, size = 746, normalized size = 3.91 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 534 vs. \(2 (145) = 290\).
time = 1.46, size = 534, normalized size = 2.80 \begin {gather*} -\frac {3 \, \sqrt {2} {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a d^{2}}} \log \left (\frac {i \, \sqrt {2} a d \sqrt {-\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) - 3 \, \sqrt {2} {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a d^{2}}} \log \left (\frac {-i \, \sqrt {2} a d \sqrt {-\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) + 2 \, \sqrt {2} {\left ({\left (7 \, A + 15 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - {\left (11 \, A + 3 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 15 \, {\left (A + i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 3 \, A + 3 i \, B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{12 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + B \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \tan ^{\frac {5}{2}}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {A+B\,\mathrm {tan}\left (c+d\,x\right )}{{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________